package com.itheima.mall.service.umsService;

import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

import java.lang.reflect.Array;
import java.util.ArrayList;

@Service
public class UmsAdminRoleRelationService {

    @DubboReference
    private UmsAdminRoleRelationApi umsAdminRoleRelationApi;

    /**
     * 给用户分配角色
     * @param adminId 用户ID
     * @param roleIds 角色标识数组
     * @return
     */
    public void roleUpdate(Integer adminId, ArrayList<Integer> roleIds) {
        umsAdminRoleRelationApi.roleUpdate(adminId,roleIds);
    }

    /**
     * 根据管理员ID获取对应角色IDS
     * @param adminId
     * @return
     */
    public ArrayList<Long> getRoleIDs(Long adminId) {
        return umsAdminRoleRelationApi.getRoleIDs(adminId);
    }
}
